﻿using Himp.TaskScheduling.Datas;
using Himp.TaskScheduling.Tasks;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace Himp.TaskScheduling.EntityFrameworkCore;

[ConnectionStringName(TaskSchedulingDbProperties.ConnectionStringName)]
public class TaskSchedulingDbContext : AbpDbContext<TaskSchedulingDbContext>, ITaskSchedulingDbContext
{
    /// <summary>
    /// 参数配置
    /// </summary>
    public DbSet<BizflowConfig> BizflowConfigs { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<BizflowNode> BizflowNodes { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<BizflowNodeAssocCandidateUser> BizflowNodeAssocCandidateUsers { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<SampleObtainTask> SampleObtainTasks { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<ParamConfig> ParamConfigs { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<ParamConfigTask> ParamConfigTasks { get; set; }

    /// <summary>
    /// 制样任务
    /// </summary>
    public DbSet<SamplePreparationTask> SamplePreparationTasks { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<SamplePreparationResult> SamplePreparationResults { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<SamplePreparationPlan> SamplePreparationPlans { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<StandardTestTask> StandardTestTasks { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<StandardTestItem> StandardTestItems { get; set; }

    public DbSet<SampleTestTask> SampleTestTasks { get; set; }

    #region 消息

    /// <summary>
    /// 
    /// </summary>
    public DbSet<EventMsgTopic> EventMsgTopics { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<EventMsgRec> EventMsgRecs { get; set; }

    #endregion

    public DbSet<CodeConversion> CodeConversions { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public DbSet<CmDeviceControl> CmDeviceControls { get; set; }

    public DbSet<ZYOperateRecord> ZYOperateRecords { get; set; }


    /// <summary>
    /// 
    /// </summary>
    /// <param name="options"></param>
    public TaskSchedulingDbContext(DbContextOptions<TaskSchedulingDbContext> options)
        : base(options)
    {

    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="builder"></param>
    protected override void OnModelCreating(ModelBuilder builder)
    {
        base.OnModelCreating(builder);
        builder.ConfigureTaskScheduling();
    }
}
